{$CLEO .cs}
{$USE CLEO+}
{$USE newOpcodes}
{$USE ini}

0000: NOP

script_name "StartBP2"

// By ArtemQa146

wait 500

if
    0AA2: 31@ = load_dynamic_library "CLEO+.cleo"
then
    if
        0AA4: 30@ = get_dynamic_library_procedure "GetCleoPlusVersion" library 31@
    then
        0AA7: call_function_return 30@ num_params 0 pop 0 29@
        if
            not 29@ >= 0x1020000
        then
            0AD1: show_formatted_text_highpriority "Cleo+ 1.2.0 (or higher) version is required, the Busy Pedestrians mod is disabled" time 15000
            0AA3: free_dynamic_library 31@
            0A93: terminate_this_custom_script
        end
        0AA3: free_dynamic_library 31@
    end
else
    0AD1: show_formatted_text_highpriority "Cleo+ 1.2.0 (or higher) version is required, the Busy Pedestrians mod is disabled" time 15000
    0AA3: free_dynamic_library 31@
    0A93: terminate_this_custom_script
end

if
    0E2D: is_game_first_start
then
    0F00: load_special_model_dff "modelsq\tagqa1" txd "modelsq\OtherQa" store_to 0@
    0AF1: write_int 0@ to_ini_file "cleo\PedsModels.ini" section "Models" key "tagqa1"
    0F00: load_special_model_dff "modelsq\tagqa2" txd "modelsq\OtherQa" store_to 0@
    0AF1: write_int 0@ to_ini_file "cleo\PedsModels.ini" section "Models" key "tagqa2"
    0F00: load_special_model_dff "modelsq\tagqa3" txd "modelsq\OtherQa" store_to 0@
    0AF1: write_int 0@ to_ini_file "cleo\PedsModels.ini" section "Models" key "tagqa3"
    
    0F00: load_special_model_dff "modelsq\tagqab1" txd "modelsq\OtherQa" store_to 0@
    0AF1: write_int 0@ to_ini_file "cleo\PedsModels.ini" section "Models" key "tagqab1"
    0F00: load_special_model_dff "modelsq\tagqab2" txd "modelsq\OtherQa" store_to 0@
    0AF1: write_int 0@ to_ini_file "cleo\PedsModels.ini" section "Models" key "tagqab2"
    0F00: load_special_model_dff "modelsq\tagqab3" txd "modelsq\OtherQa" store_to 0@
    0AF1: write_int 0@ to_ini_file "cleo\PedsModels.ini" section "Models" key "tagqab3"
    
    0F00: load_special_model_dff "modelsq\tagqav1" txd "modelsq\OtherQa" store_to 0@
    0AF1: write_int 0@ to_ini_file "cleo\PedsModels.ini" section "Models" key "tagqav1"
    0F00: load_special_model_dff "modelsq\tagqav2" txd "modelsq\OtherQa" store_to 0@
    0AF1: write_int 0@ to_ini_file "cleo\PedsModels.ini" section "Models" key "tagqav2"
    0F00: load_special_model_dff "modelsq\tagqav3" txd "modelsq\OtherQa" store_to 0@
    0AF1: write_int 0@ to_ini_file "cleo\PedsModels.ini" section "Models" key "tagqav3"
    
    0F00: load_special_model_dff "modelsq\PedPara" txd "modelsq\OtherQa" store_to 0@
    0AF1: write_int 0@ to_ini_file "cleo\PedsModels.ini" section "Models" key "PedPara"
    0F00: load_special_model_dff "modelsq\PedPara2" txd "modelsq\OtherQa" store_to 0@
    0AF1: write_int 0@ to_ini_file "cleo\PedsModels.ini" section "Models" key "PedPara2"
    
    0F00: load_special_model_dff "modelsq\SportQa" txd "modelsq\OtherQa" store_to 0@
    0AF1: write_int 0@ to_ini_file "cleo\PedsModels.ini" section "Models" key "SportQa"
    0F00: load_special_model_dff "modelsq\SportQa2" txd "modelsq\OtherQa" store_to 0@
    0AF1: write_int 0@ to_ini_file "cleo\PedsModels.ini" section "Models" key "SportQa2"
    0F00: load_special_model_dff "modelsq\birdq" txd "modelsq\OtherQa" store_to 0@
    0AF1: write_int 0@ to_ini_file "cleo\PedsModels.ini" section "Models" key "bird"
    0F00: load_special_model_dff "modelsq\flshlightq" txd "modelsq\OtherQa" store_to 0@
    0AF1: write_int 0@ to_ini_file "cleo\PedsModels.ini" section "Models" key "flshlight"
    0F00: load_special_model_dff "modelsq\maph" txd "modelsq\OtherQa" store_to 0@
    0AF1: write_int 0@ to_ini_file "cleo\PedsModels.ini" section "Models" key "maph"
    0F00: load_special_model_dff "modelsq\cops_peds2" txd "modelsq\OtherQa" store_to 0@
    0AF1: write_int 0@ to_ini_file "cleo\PedsModels.ini" section "Models" key "copB2"
end


timera = 0
timerb = 0

const

    render_para1 = 30@
    render_para2 = 29@
    render_sport = 28@
    render_sport_2 = 27@
    chance_rap = 26@
    chance_fight = 25@
    chance_pedpara = 24@
    chance_baseball = 23@
    chance_bum = 22@
    chance_car_search = 21@
    chanse_time_trash = 20@
    chanse_graffity = 19@
    chance_door = 18@

    scr_shop = 16@
    render_bird = 14@
    chance_hunt = 15@
    render_flash = 13@
    chance_crime = 12@
    render_map = 11@
    chance_tourist = 10@
    chance_monk = 9@
    
    render_book = 17@
    pause = 400
end

0AF0: scr_shop = read_int_from_ini_file "cleo\Busy Pedestrians.ini" section "Settings" key "Ottos Auto"

0AF0: render_book = read_int_from_ini_file "cleo\PedsModels.ini" section "Models" key "copB2"

0AF0: render_para1 = read_int_from_ini_file "cleo\PedsModels.ini" section "Models" key "PedPara"
0AF0: render_para2 = read_int_from_ini_file "cleo\PedsModels.ini" section "Models" key "PedPara2"
0AF0: render_sport = read_int_from_ini_file "cleo\PedsModels.ini" section "Models" key "SportQa"
0AF0: render_sport_2 = read_int_from_ini_file "cleo\PedsModels.ini" section "Models" key "SportQa2"
0AF0: render_bird = read_int_from_ini_file "cleo\PedsModels.ini" section "Models" key "bird"
0AF0: render_flash = read_int_from_ini_file "cleo\PedsModels.ini" section "Models" key "flshlight"
0AF0: render_map = read_int_from_ini_file "cleo\PedsModels.ini" section "Models" key "maph"

0AF0: chance_rap = read_int_from_ini_file "cleo\Busy Pedestrians.ini" section "Percent Chance" key "Rap Battles"
0AF0: chance_fight = read_int_from_ini_file "cleo\Busy Pedestrians.ini" section "Percent Chance" key "Street Fight"
0AF0: chance_pedpara = read_int_from_ini_file "cleo\Busy Pedestrians.ini" section "Percent Chance" key "Parachute Ped"
0AF0: chance_bum = read_int_from_ini_file "cleo\Busy Pedestrians.ini" section "Percent Chance" key "Bum"
0AF0: chance_baseball = read_int_from_ini_file "cleo\Busy Pedestrians.ini" section "Percent Chance" key "Baseball"
0AF0: chance_car_search = read_int_from_ini_file "cleo\Busy Pedestrians.ini" section "Percent Chance" key "Cops Search Peds"
0AF0: chanse_graffity = read_int_from_ini_file "cleo\Busy Pedestrians.ini" section "Percent Chance" key "Graffity Gang"
0AF0: chance_door = read_int_from_ini_file "cleo\Busy Pedestrians.ini" section "Percent Chance" key "Door In Out Peds"
0AF0: chance_hunt = read_int_from_ini_file "cleo\Busy Pedestrians.ini" section "Percent Chance" key "Hunter"
0AF0: chance_crime = read_int_from_ini_file "cleo\Busy Pedestrians.ini" section "Percent Chance" key "Police Crime Scene"
0AF0: chance_tourist = read_int_from_ini_file "cleo\Busy Pedestrians.ini" section "Percent Chance" key "Tourist"
0AF0: chance_monk = read_int_from_ini_file "cleo\Busy Pedestrians.ini" section "Percent Chance" key "Monk"

0AF0: chanse_time_trash = read_int_from_ini_file "cleo\Busy Pedestrians.ini" section "Peds throwing garbage" key "Time Peds throw again"
chanse_time_trash *= 1000

while true
wait pause

    if
        player.Defined(0)
    then

        if
            not $ACTIVE_INTERIOR == 0
        then
            continue
        end

            if and
                $ONMISSION == 0
                $ACTIVE_INTERIOR == 0
            then
                0E40: get_current_hour 2@
                if and
                    timera > 20000
                    2@ >= 6
                    2@ <= 19
                then
                    0D59: get_current_weather_to 1@
                    if or
                        1@ == 0
                        1@ == 2
                        1@ == 6
                        1@ == 11
                        1@ == 13
                        1@ == 17
                    then
                        0AAA: 1@ = get_script_struct_named "HOTQA"
                        if
                            1@ == 0
                        then
                            0A92: stream_custom_script "Hot reaction.qa"
                            wait 2000
                            timera = 0
                        end
                    else
                        0AAA: 1@ = get_script_struct_named "ANMQA"
                        if
                            1@ == 0
                        then
                            0A92: stream_custom_script "Random Animation.qa"
                            wait 2000
                            timera = 0
                        end
                    end
                end
            end
            
            wait pause

            // Baseball
            if or
                0EEA: locate_char_distance_to_coordinates $player_actor pos -2307.1387 206.304 35.3056 radius 100.0
                0EEA: locate_char_distance_to_coordinates $player_actor pos 1383.2197 2184.4348 11.0234 radius 100.0
            then
                0E40: get_current_hour 2@
                if and
                    80C2:   not sphere_onscreen -2307.1387 206.304 35.3056 radius 5.0
                    80C2:   not sphere_onscreen 1383.2197 2184.4348 11.0234 radius 5.0
                    not locate_char_distance_to_coordinates $player_actor pos -2307.1387 206.304 35.3056 radius 20.0
                    not locate_char_distance_to_coordinates $player_actor pos 1383.2197 2184.4348 11.0234 radius 20.0
                    $ACTIVE_INTERIOR == 0
                    2@ >= 9
                    2@ <= 18
                    $ONMISSION == 0
                then
                    0AAA: 1@ = get_script_struct_named "BballQA"
                    if
                        1@ == 0
                    then
                        0A92: stream_custom_script "Baseball peds.qa" chance_baseball
                        wait 2000
                    end
                end
            end
            
            // car shop
            if and
                scr_shop == 1
                0EEA: locate_char_distance_to_coordinates $player_actor pos -1648.5743 1207.5776 7.2 radius 100.0
            then
                0E40: get_current_hour 2@
                if and
                    $ACTIVE_INTERIOR == 0
                    2@ >= 9
                    2@ <= 18
                    $ONMISSION == 0
                then
                    0AAA: 1@ = get_script_struct_named "CRSHQA"
                    if
                        1@ == 0
                    then
                        0A92: stream_custom_script "Car shop.qa"
                        wait 2000
                    end
                end
            end
            
            wait pause

            // Fight
            if or
                0EEA: locate_char_distance_to_coordinates $player_actor pos 1577.3643 -1527.8503 13.5689 radius 100.0 // LS
                0EEA: locate_char_distance_to_coordinates $player_actor pos -2529.9075 222.9464 11.0938 radius 100.0 // SF
                0EEA: locate_char_distance_to_coordinates $player_actor pos 1102.1049 -1203.999 17.8047 radius 100.0 // LS
            then
                0E40: get_current_hour 2@
                if and
                    $ACTIVE_INTERIOR == 0
                    $ONMISSION == 0
                    2@ >= 12
                    2@ < 19
                    887A:   not gang_war_in_progress
                then
                    1@ = 0.0
                    2@ = 0.0
                    3@ = 0.0
                    
                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos 1577.3643 -1527.8503 13.5689 radius 100.0 // LS
                    then
                        1@ = 1577.3643
                        2@ = -1527.8503
                        3@ = 13.5689
                    end
                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos -2529.9075 222.9464 11.0938 radius 100.0 // SF
                    then
                        1@ = -2529.9075 
                        2@ = 222.9464
                        3@ = 11.0938
                    end
                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos 1102.1049 -1203.999 17.8047 radius 100.0 // LS
                    then
                        1@ = 1102.1049
                        2@ = -1203.999
                        3@ = 17.8047
                    end
                    if and
                        not 1@ == 0.0
                        not 2@ == 0.0
                        not 3@ == 0.0
                        80C2:   not sphere_onscreen 1@ 2@ 3@ radius 5.0
                    then
                        0AAA: 0@ = get_script_struct_named "StrtFH"
                        if
                            0@ == 0
                        then
                            0A92: stream_custom_script "Street Fight.qa" 1@ 2@ 3@ chance_fight
                            wait 2000
                        end
                    end
                end
            end
            
            wait pause
            
            // RapBattle
                0E40: get_current_hour 2@
                if and
                    $ACTIVE_INTERIOR == 0
                    $ONMISSION == 0
                    2@ >= 12
                    2@ < 23
                    887A:   not gang_war_in_progress
                then
                    1@ = 0.0
                    2@ = 0.0
                    3@ = 0.0
                    
                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos -2532.885 42.9645 8.5918 radius 100.0 // SF
                    then
                        1@ = -2532.885
                        2@ = 42.9645
                        3@ = 8.5918
                        4@ = 92.1194
                    end
                    
                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos -1701.1898 1342.7102 7.1797 radius 100.0 // SF
                    then
                        1@ =-1701.1898 
                        2@ = 1342.7102
                        3@ = 7.1797
                        4@ = 131.4299
                    end
                    
                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos 2163.1917 -1787.0269 13.5191 radius 100.0 // LS
                    then
                        1@ = 2163.1917
                        2@ = -1787.0269
                        3@ = 13.5191
                        4@ = 172.4077
                    end
                    
                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos 2154.5642 -1128.0868 25.5791 radius 100.0 // LS
                    then
                        1@ = 2154.5642 
                        2@ = -1128.0868
                        3@ = 25.5791
                        4@ = 168.8442
                    end
                    
                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos 970.7272 -1290.0144 13.5469 radius 100.0 // LS
                    then
                        1@ = 970.7272 
                        2@ = -1290.0144
                        3@ = 13.5469
                        4@ = 272.0045
                    end
                    
                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos 1688.8214 -1956.7809 8.25 radius 100.0 // LS
                    then
                        1@ = 1688.8214 
                        2@ = -1956.7809
                        3@ = 8.25
                        4@ = 267.6756
                    end
                    
                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos 284.4816 -1512.5848 24.9219 radius 100.0 // LS
                    then
                        1@ = 284.4816
                        2@ = -1512.5848
                        3@ = 24.9219
                        4@ = 235.2222
                    end
                    
                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos -2493.061 2289.7944 4.9844 radius 100.0 // LS
                    then
                        1@ = -2493.061
                        2@ = 2289.7944
                        3@ = 4.9844
                        4@ = 1.8854
                    end
                    
                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos 2498.0444 1280.3204 10.8125 radius 100.0 // LS
                    then
                        1@ = 2498.0444 
                        2@ = 1280.3204
                        3@ = 10.8125
                        4@ = 181.0867
                    end

                    if and
                        not 1@ == 0.0
                        not 2@ == 0.0
                        not 3@ == 0.0
                        not locate_char_distance_to_coordinates $player_actor pos 1@ 2@ 3@ radius 20.0
                        80C2:   not sphere_onscreen 1@ 2@ 3@ radius 5.0
                    then
                        0AAA: 0@ = get_script_struct_named "RPBTL"
                        if
                            0@ == 0
                        then
                            0A92: stream_custom_script "Rap Battle.qa" 1@ 2@ 3@ 4@ chance_rap
                            wait 2000
                        end
                    end
                end
            
            wait pause
            
            // Golf
                0E40: get_current_hour 2@
                if and
                    $ACTIVE_INTERIOR == 0
                    $ONMISSION == 0
                    2@ >= 10
                    2@ < 18
                then
                    1@ = 0.0
                    2@ = 0.0
                    3@ = 0.0

                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos 1249.9968 2803.8433 10.8203 radius 80.0
                    then
                        1@ = 1249.9968
                        2@ = 2803.8433
                        3@ = 10.8203
                        4@ = 220.926
                    end

                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos 1236.0132 2777.0754 10.8203 radius 80.0
                    then
                        1@ = 1236.0132 
                        2@ = 2777.0754
                        3@ = 10.8203
                        4@ = 220.4299
                    end

                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos 1183.1127 2744.4714 10.8281 radius 80.0
                    then
                        1@ = 1183.1127 
                        2@ = 2744.4714
                        3@ = 10.8281
                        4@ = 63.4077
                    end

                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos 1366.426 2746.4771 10.8203 radius 80.0
                    then
                        1@ = 1366.426 
                        2@ = 2746.4771
                        3@ = 10.8203
                        4@ = 102.8442
                    end

                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos 1343.6796 2796.6335 10.8203 radius 80.0
                    then
                        1@ = 1343.6796
                        2@ = 2796.6335
                        3@ = 10.8203
                        4@ = 248.0045
                    end
                    
                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos -2461.1292 -260.4898 39.6122 radius 80.0 // SF
                    then
                        1@ = -2461.1292
                        2@ = -260.4898
                        3@ = 39.6122
                        4@ = 80.5532
                    end
                    
                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos -2377.7419 -238.7513 42.734 radius 80.0 // SF
                    then
                        1@ = -2377.7419
                        2@ = -238.7513
                        3@ = 42.734
                        4@ = 247.6713
                    end
                    
                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos -2515.2852 -301.6659 39.179 radius 80.0 // SF
                    then
                        1@ = -2515.2852
                        2@ = -301.6659
                        3@ = 39.179
                        4@ = 309.4219
                    end
                    
                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos -2545.9565 -252.4858 21.7176 radius 80.0 // SF
                    then
                        1@ = -2545.9565
                        2@ = -252.4858
                        3@ = 21.7176
                        4@ = 79.76984
                    end
                    
                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos -2556.9011 -304.8829 25.9661 radius 80.0 // SF
                    then
                        1@ = -2556.9011 
                        2@ = -304.8829
                        3@ = 25.9661
                        4@ = 89.76984
                    end

                    if and
                        not 1@ == 0.0
                        not 2@ == 0.0
                        not 3@ == 0.0
                        not locate_char_distance_to_coordinates $player_actor pos 1@ 2@ 3@ radius 10.0
                        80C2:   not sphere_onscreen 1@ 2@ 3@ radius 5.0
                    then
                        0AAA: 0@ = get_script_struct_named "GLFQA"
                        if
                            0@ == 0
                        then
                            0A92: stream_custom_script "Golf Peds.qa" 1@ 2@ 3@ 4@
                            wait 2000
                        end
                    end
                end
                
            wait pause

            // Bum
            
            0E40: get_current_hour 2@
            if and
                $ACTIVE_INTERIOR == 0
                $ONMISSION == 0
                2@ >= 9
                2@ < 18
                887A:   not gang_war_in_progress
            then
                1@ = 0.0
                2@ = 0.0
                3@ = 0.0

                if
                    0EEA: locate_char_distance_to_coordinates $player_actor pos -2032.3612 -58.9917 35.3224 radius 80.0 // SF
                then
                    1@ = -2032.3612
                    2@ = -58.9917
                    3@ = 35.3224
                    4@ = 267.9798
                end
                
                if
                    0EEA: locate_char_distance_to_coordinates $player_actor pos -2216.345 448.5254 35.2429 radius 80.0 // SF
                then
                    1@ = -2216.345
                    2@ = 448.5254
                    3@ = 35.2429
                    4@ = 67.973
                end
                
                if
                    0EEA: locate_char_distance_to_coordinates $player_actor pos -1903.3071 1191.6415 45.4454 radius 80.0 // SF
                then
                    1@ = -1903.3071
                    2@ = 1191.6415
                    3@ = 45.4454
                    4@ = 224.6377
                end
                
                if
                    0EEA: locate_char_distance_to_coordinates $player_actor pos -2406.1245 719.4592 35.1719 radius 80.0 // SF
                then
                    1@ = -2406.1245
                    2@ = 719.4592
                    3@ = 35.1719
                    4@ = 174.4234
                end
                
                if
                    0EEA: locate_char_distance_to_coordinates $player_actor pos -1543.7351 695.316 7.1875 radius 80.0 // SF
                then
                    1@ = -1543.7351
                    2@ = 695.316
                    3@ = 7.1875
                    4@ = 183.7392
                end
                
                if
                    0EEA: locate_char_distance_to_coordinates $player_actor pos -2186.7329 -2407.0276 30.625 radius 80.0 // SF Country
                then
                    1@ = -2186.7329
                    2@ = -2407.0276
                    3@ = 30.625
                    4@ = 56.8564
                end
                
                if
                    0EEA: locate_char_distance_to_coordinates $player_actor pos 143.7168 -158.6587 1.5847 radius 80.0 // LS Country
                then
                    1@ = 143.7168 
                    2@ = -158.6587
                    3@ = 1.5847
                    4@ = 90.2431
                end
                
                if
                    0EEA: locate_char_distance_to_coordinates $player_actor pos 1292.2303 388.1553 19.5614 radius 80.0 // LS Country
                then
                    1@ = 1292.2303
                    2@ = 388.1553
                    3@ = 19.5614
                    4@ = 196.139
                end
                
                if
                    0EEA: locate_char_distance_to_coordinates $player_actor pos 1971.6299 -2028.985 13.5469 radius 80.0 // LS
                then
                    1@ = 1971.6299
                    2@ = -2028.985
                    3@ = 13.5469
                    4@ = 91.9665
                end
                
                if
                    0EEA: locate_char_distance_to_coordinates $player_actor pos 2113.0051 -1627.5165 13.5386 radius 80.0 // LS
                then
                    1@ = 2113.0051
                    2@ = -1627.5165
                    3@ = 13.5386
                    4@ = 345.3856
                end
                
                if
                    0EEA: locate_char_distance_to_coordinates $player_actor pos 2652.573 -1619.2847 10.8833 radius 80.0 // LS
                then
                    1@ = 2652.573 
                    2@ = -1619.2847
                    3@ = 10.8833
                    4@ = 79.3024
                end
                
                if
                    0EEA: locate_char_distance_to_coordinates $player_actor pos 2520.8865 -1388.5905 28.5313 radius 80.0 // LS
                then
                    1@ = 2520.8865
                    2@ = -1388.5905
                    3@ = 28.5313
                    4@ = 94.3515
                end
                
                if
                    0EEA: locate_char_distance_to_coordinates $player_actor pos 1970.7013 -1175.2072 20.0308 radius 80.0 // LS
                then
                    1@ = 1970.7013
                    2@ = -1175.2072
                    3@ = 20.0308
                    4@ = 178.3256
                end
                
                if
                    0EEA: locate_char_distance_to_coordinates $player_actor pos 841.7798 -1344.184 7.1719 radius 80.0 // LS
                then
                    1@ = 841.7798
                    2@ = -1344.184
                    3@ = 7.1719
                    4@ = 102.1732
                end

                if
                    0EEA: locate_char_distance_to_coordinates $player_actor pos 938.6911 -1834.3002 12.6018 radius 80.0 // LS
                then
                    1@ = 938.6911
                    2@ = -1834.3002
                    3@ = 12.6018
                    4@ = 350.7939
                end
                
                if
                    0EEA: locate_char_distance_to_coordinates $player_actor pos 2713.7866 -1151.2162 69.5781 radius 80.0 // LS
                then
                    1@ = 2713.7866 
                    2@ = -1151.2162
                    3@ = 69.5781
                    4@ = 270.325
                end
                
                if
                    0EEA: locate_char_distance_to_coordinates $player_actor pos 1671.1831 -1746.1335 13.5472 radius 80.0 // LS
                then
                    1@ = 1671.1831 
                    2@ = -1746.1335
                    3@ = 13.5472
                    4@ = 268.665
                end
                
                if
                    0EEA: locate_char_distance_to_coordinates $player_actor pos 1780.6523 -1189.923 23.8857 radius 80.0 // LS
                then
                    1@ =1780.6523
                    2@ = -1189.923
                    3@ = 23.8857
                    4@ =357.4842
                end
                
                if
                    0EEA: locate_char_distance_to_coordinates $player_actor pos -163.4735 1188.8268 19.7422 radius 80.0 // LV Country
                then
                    1@ = -163.4735
                    2@ = 1188.8268
                    3@ = 19.7422
                    4@ = 1.2743
                end
                
                if
                    0EEA: locate_char_distance_to_coordinates $player_actor pos 1684.9882 2182.5857 10.8203 radius 80.0 // LV
                then
                    1@ = 1684.9882 
                    2@ = 2182.5857
                    3@ = 10.8203
                    4@ = 180.0858
                end
                
                if
                    0EEA: locate_char_distance_to_coordinates $player_actor pos 2586.8711 2296.5435 10.8203 radius 80.0 // LV
                then
                    1@ = 2597.8711
                    2@ = 2301.5435
                    3@ = 10.8203
                    4@ = 186.1007
                end


                if and
                    not 1@ == 0.0
                    not 2@ == 0.0
                    not 3@ == 0.0
                    not locate_char_distance_to_coordinates $player_actor pos 1@ 2@ 3@ radius 10.0
                    80C2:   not sphere_onscreen 1@ 2@ 3@ radius 5.0
                then
                    0AAA: 0@ = get_script_struct_named "BUMQA"
                    if
                        0@ == 0
                    then
                        0A92: stream_custom_script "BUMQA.qa" 1@ 2@ 3@ 4@ chance_bum
                        wait 2000
                    end
                end
            end
            
            wait pause
            
            
            // Graffity

            0E40: get_current_hour 2@
            if and
                $ACTIVE_INTERIOR == 0
                $ONMISSION == 0
                2@ >= 12
                2@ < 20
                887A:   not gang_war_in_progress
            then
                1@ = 0.0
                2@ = 0.0
                3@ = 0.0

                if
                    0EEA: locate_char_distance_to_coordinates $player_actor pos 1994.274 -1923.8625 13.5468 radius 100.0 // LS
                then
                    1@ = 1994.4503
                    2@ = -1923.34
                    3@ = 13.5468
                    4@ = 0.4723
                end

                if
                    0EEA: locate_char_distance_to_coordinates $player_actor pos 2013.4692 -2123.6572 13.5469 radius 100.0 // LS
                then
                    1@ = 2013.4692
                    2@ = -2123.6572
                    3@ = 13.5469
                    4@ = 265.5291
                end
                
                if
                    0EEA: locate_char_distance_to_coordinates $player_actor pos 2045.4768 -1703.5907 13.5547 radius 100.0 // LS
                then
                    1@ = 2045.4768
                    2@ = -1703.5907
                    3@ = 13.5547
                    4@ = 266.4324
                end

                if
                    0EEA: locate_char_distance_to_coordinates $player_actor pos 1980.8013 -1167.9213 20.4495 radius 100.0 // LS
                then
                    1@ = 1980.8013
                    2@ = -1167.9213
                    3@ = 20.4495
                    4@ = 90.0
                end
                
                if
                    0EEA: locate_char_distance_to_coordinates $player_actor pos 2561.9968 -1286.7627 46.1328 radius 100.0 // LS
                then
                    1@ = 2562.1
                    2@ = -1286.7627
                    3@ = 46.1328
                    4@ = 90.0
                end

                if
                    0EEA: locate_char_distance_to_coordinates $player_actor pos 2686.6 -1101.3744 69.3505 radius 100.0 // LS
                then
                    1@ = 2686.55
                    2@ = -1101.3744
                    3@ = 69.3505
                    4@ = 270.9773
                end

                if
                    0EEA: locate_char_distance_to_coordinates $player_actor pos 2755.6104 -2003.8591 13.5547 radius 100.0 // LS
                then
                    1@ = 2755.6104 
                    2@ = -2003.8591
                    3@ = 13.5547
                    4@ = 180.8792
                end
                
                if
                    0EEA: locate_char_distance_to_coordinates $player_actor pos 2579.9348 -1449.5624 24.0064 radius 100.0 // LS
                then
                    1@ = 2579.9348
                    2@ = -1449.5624
                    3@ = 24.0064
                    4@ = 269.3756
                end
                
                if
                    0EEA: locate_char_distance_to_coordinates $player_actor pos 505.6121 -1762.5573 5.5615 radius 100.0 // LS
                then
                    1@ = 505.6121 
                    2@ = -1762.6573
                    3@ = 5.5615
                    4@ = 0.0
                end

                if and
                    not 1@ == 0.0
                    not 2@ == 0.0
                    not 3@ == 0.0
                    not locate_char_distance_to_coordinates $player_actor pos 1@ 2@ 3@ radius 20.0
                    80C2:   not sphere_onscreen 1@ 2@ 3@ radius 5.0
                then
                
                    0AAA: 0@ = get_script_struct_named "GRFGQA"
                    if
                        0@ == 0
                    then
                        08F1: get_zone_at 1@ 2@ 3@ nameB_to 7@s // 8-byte string
                        076D: get_zone 7@s gang 0 density_to 6@
                        if not 6@ == 0
                        then 5@ = 7
                        end
                        076D: get_zone 7@s gang 1 density_to 6@
                        if not 6@ == 0
                        then 5@ = 8
                        end
                        076D: get_zone 7@s gang 2 density_to 6@
                        if not 6@ == 0
                        then 5@ = 9
                        end
                        if or
                            not 5@ == 7
                            not 5@ == 8
                            not 5@ == 9
                        then
                            0A92: stream_custom_script "Graffiti Gang.qa" 1@ 2@ 3@ 4@ 5@ chanse_graffity
                            wait 2000
                        end
                    end
                end
            end
            
            wait pause
            
            // Para Jumper
            0E40: get_current_hour 2@
            0D59: get_current_weather_to 1@
            if and
                $ACTIVE_INTERIOR == 0
                $ONMISSION == 0
                2@ >= 10
                2@ < 14
                not 1@ == 8
                not 1@ == 16
            then
                1@ = 0.0
                2@ = 0.0
                3@ = 0.0

                
                if
                    0EEA: locate_char_distance_to_coordinates $player_actor pos -1083.4521 -991.4529 129.2183 radius 300.0
                then
                    1@ = -1144.8926
                    2@ = -985.8846
                    3@ = 129.2183
                    0208: 4@ = random_float_in_ranges 0.0 360.0
                end
                
                if
                    0EEA: locate_char_distance_to_coordinates $player_actor pos -261.062 -1358.5576 8.9296 radius 300.0
                then
                    1@ = -261.062
                    2@ = -1358.5576
                    3@ = 8.9296
                    0208: 4@ = random_float_in_ranges 0.0 360.0
                end
                
                if
                    0EEA: locate_char_distance_to_coordinates $player_actor pos -137.8166 57.0996 3.1172 radius 300.0
                then
                    1@ = -137.8166
                    2@ = 57.0996
                    3@ = 3.1172
                    0208: 4@ = random_float_in_ranges 0.0 360.0
                end
                
                if
                    0EEA: locate_char_distance_to_coordinates $player_actor pos -2900.6035 464.9078 4.9141 radius 300.0
                then
                    1@ = -2900.6035
                    2@ = 464.9078
                    3@ = 4.9141
                    0208: 4@ = random_float_in_ranges 0.0 360.0
                end
                
                if
                    0EEA: locate_char_distance_to_coordinates $player_actor pos -2259.9863 2316.0886 4.8125 radius 300.0
                then
                    1@ = -2259.9863
                    2@ = 2316.0886
                    3@ = 4.8125
                    0208: 4@ = random_float_in_ranges 0.0 360.0
                end

                if and
                    not 1@ == 0.0
                    not 2@ == 0.0
                    not 3@ == 0.0
                    not locate_char_distance_to_coordinates $player_actor pos 1@ 2@ 3@ radius 20.0
                then
                    0AAA: 0@ = get_script_struct_named "PEDPARQ"
                    if
                        0@ == 0
                    then
                        0A92: stream_custom_script "Para Jumper.qa" 1@ 2@ 3@ 4@ render_para1 render_para2 chance_pedpara
                        wait 2000
                    end
                end
            end

            
            wait pause
            
            // In out Peds

                if and
                    $ACTIVE_INTERIOR == 0
                    $ONMISSION == 0
                then
                    1@ = 0.0
                    2@ = 0.0
                    3@ = 0.0
                    
                    // 1498 -   
                    // 1507 -  , 
                    // 1504 -  , 
                    // 1505 -  , 
                    // 1506 -  , 
                    // 1569 -     
                    // 1522 -    
                    // 1499 -  
                    // 1497 - 

                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos 2015.3446 -1732.4221 14.2344 radius 100.0 // LS
                    then
                        1@ = 2015.3446 
                        2@ = -1732.6221
                        3@ = 14.2344
                        4@ = 270.0
                        5@ = 1498
                    end
                    
                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos 2016.5448 -1641.6697 14.1129 radius 100.0 // LS
                    then
                        1@ = 2016.5448
                        2@ = -1641.6697
                        3@ = 14.1129
                        4@ = 270.0
                        5@ = 1498
                    end
                    
                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos 2139.1965 -1742.7756 13.5524 radius 100.0 // LS
                    then
                        1@ = 2139.1965
                        2@ = -1742.7756
                        3@ = 13.5524
                        4@ = 0.0
                        5@ = 1522
                    end
                    
                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos 1938.5405 -1911.283 15.2568 radius 100.0 // LS
                    then
                        1@ = 1928.6332
                        2@ = -1915.903
                        3@ = 15.2568
                        4@ = 0.0
                        5@ = 1498
                    end
                    
                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos 1891.8796 -1914.3961 15.2568 radius 100.0 // LS
                    then
                        1@ = 1891.8796
                        2@ = -1914.3961
                        3@ = 15.2568
                        4@ = 0.0
                        5@ = 1498
                    end
                    
                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos 2190.446 -1470.4694 25.914 radius 100.0 // LS
                    then
                        1@ = 2190.446
                        2@ = -1470.4694
                        3@ = 25.914
                        4@ = 90.0
                        5@ = 1498
                    end
                    
                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos 2150.9158 -1419.0348 25.9219 radius 100.0 // LS
                    then
                        1@ = 2150.9158
                        2@ = -1419.0348
                        3@ = 25.9219
                        4@ = 270.0
                        5@ = 1498
                    end
                    
                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos 2091.0435 -1277.8356 26.1797 radius 100.0 // LS
                    then
                        1@ = 2091.0435
                        2@ = -1277.8356
                        3@ = 26.1797
                        4@ = 0.0
                        5@ = 1498
                    end
                    
                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos 2526.8342 -1033.5155 69.5793 radius 100.0 // LS
                    then
                        1@ = 2526.8342
                        2@ = -1033.5155
                        3@ = 69.5793
                        4@ = 0.0
                        5@ = 1497
                    end

                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos 2091.6345 -1184.295 27.057 radius 100.0 // LS
                    then
                        1@ = 2091.6345
                        2@ = -1184.295
                        3@ = 27.057
                        4@ = 0.0
                        5@ = 1498
                    end

                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos 2139.418 -1185.0061 23.9836 radius 100.0 // LS
                    then
                        1@ = 2139.418
                        2@ = -1185.0061
                        3@ = 23.9836
                        4@ = 90.0
                        5@ = 1522
                    end
                    
                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos 1999.9677 -1114.0543 27.125 radius 100.0 // LS
                    then
                        1@ = 1999.9677
                        2@ = -1114.0543
                        3@ = 27.125
                        4@ = 0.0
                        5@ = 1498
                    end
                    
                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos 1852.311 -1092.8716 23.8281 radius 100.0 // LS
                    then
                        1@ = 1852.311
                        2@ = -1092.8716
                        3@ = 23.8281
                        4@ = 90.0
                        5@ = 1522
                    end
                    
                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos 2033.4084 -1085.7589 24.5625 radius 100.0 // LS
                    then
                        1@ = 2033.4084
                        2@ = -1085.7589
                        3@ = 24.5625
                        4@ = 156.804
                        5@ = 1522
                    end

                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos 1641.5684 -1171.9128 24.0781 radius 100.0 // LS
                    then
                        1@ = 1641.5684
                        2@ = -1171.9128
                        3@ = 24.0781
                        4@ = 180.0
                        5@ = 1569
                    end
                    
                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos 899.1205 -1336.2618 13.5469 radius 100.0 // LS
                    then
                        1@ = 899.1205
                        2@ = -1336.4618
                        3@ = 13.5469
                        4@ = 180.0
                        5@ = 1569
                    end

                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos 1162.431 -1602.3977 13.5469 radius 100.0 // LS
                    then
                        1@ = 1162.431
                        2@ = -1602.35
                        3@ = 13.5469
                        4@ = 270.0
                        5@ = 1522
                    end
                    
                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos 655.983 -1635.8671 15.8617 radius 100.0 // LS
                    then
                        1@ = 655.983
                        2@ = -1635.8671
                        3@ = 15.8617
                        4@ = 0.0
                        5@ = 1498
                    end
                    
                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos 1113.0703 -922.4809 43.3906 radius 100.0 // LS
                    then
                        1@ = 1113.0703
                        2@ = -922.4809
                        3@ = 43.3906
                        4@ = 0.0
                        5@ = 1522
                    end
                    
                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos 1955.1238 -1115.3958 27.8305 radius 100.0 // LS
                    then
                        1@ = 1955.1238
                        2@ = -1115.3958
                        3@ = 27.8305
                        4@ = 90.0
                        5@ = 1505
                    end
                    
                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos 2361.3975 -1339.6434 24.0079 radius 100.0 // LS
                    then
                        1@ = 2361.4975
                        2@ = -1339.6434
                        3@ = 24.0079
                        4@ = 90.0
                        5@ = 1522
                    end
                    
                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos 2367.2891 -1534.0089 24.0 radius 100.0 // LS
                    then
                        1@ = 2367.2891
                        2@ = -1534.0089
                        3@ = 24.0
                        4@ = 180.0
                        5@ = 1522
                    end
                    
                    


                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos 312.7211 -92.3443 3.5354 radius 100.0 // LS Country
                    then
                        1@ = 312.7211
                        2@ = -92.3443
                        3@ = 3.5354
                        4@ = 90.0
                        5@ = 1498
                    end
                    
                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos 248.7114 -33.1468 1.5781 radius 100.0 // LS Country
                    then
                        1@ = 248.6
                        2@ = -33.1468
                        3@ = 1.5781
                        4@ = 270.0
                        5@ = 1497
                    end

                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos 171.8483 -200.8594 1.5703 radius 100.0 // LS Country
                    then
                        1@ = 171.8483
                        2@ = -200.8594
                        3@ = 1.5703
                        4@ = 46.0
                        5@ = 1522
                    end
                    
                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos 745.1946 -556.7844 18.013 radius 100.0 // LS Country
                    then
                        1@ = 745.1946
                        2@ = -556.7844
                        3@ = 18.013
                        4@ = 180.0
                        5@ = 1498
                    end
                    
                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos 701.672 -518.4788 16.3245 radius 100.0 // LS Country
                    then
                        1@ = 701.672
                        2@ = -518.4788
                        3@ = 16.3245
                        4@ = 0.0
                        5@ = 1522
                    end
                    
                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos 691.3619 -633.2019 16.336 radius 100.0 // LS Country
                    then
                        1@ = 691.3619
                        2@ = -633.2019
                        3@ = 16.336
                        4@ = 270.0
                        5@ = 1569
                    end
                    
                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos 1301.9432 385.6221 19.5624 radius 100.0 // LS Country
                    then
                        1@ = 1301.9432
                        2@ = 385.6221
                        3@ = 19.5624
                        4@ = 332.382
                        5@ = 1569
                    end
                    
                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos 1416.8362 261.1164 19.5442 radius 100.0 // LS Country
                    then
                        1@ = 1416.8362
                        2@ = 261.1164
                        3@ = 19.5442
                        4@ = 246.2613
                        5@ = 1522
                    end
                    
                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos 2305.8171 82.3943 26.4787 radius 100.0 // LS Country
                    then
                        1@ = 2305.8171
                        2@ = 82.3943
                        3@ = 26.4787
                        4@ = 180.0
                        5@ = 1522
                    end
                    
                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos 2203.8513 106.1454 28.4416 radius 100.0 // LS Country
                    then
                        1@ = 2203.8513
                        2@ = 106.1454
                        3@ = 28.4416
                        4@ = 90.0
                        5@ = 1498
                    end
                    


                    


                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos -2156.5054 645.3824 52.3672 radius 100.0 // SF
                    then
                        1@ = -2156.5054
                        2@ = 645.3824
                        3@ = 52.3672
                        4@ = 90.0
                        5@ = 1569
                    end
                    
                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos -2791.8674 -24.3944 10.0547 radius 100.0 // SF
                    then
                        1@ = -2791.8674
                        2@ = -24.3944
                        3@ = 10.0547
                        4@ = 180.0
                        5@ = 1505
                    end
                    
                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos -2791.8623 77.5956 10.0547 radius 100.0 // SF
                    then
                        1@ = -2791.8623
                        2@ = 77.5956
                        3@ = 10.0547
                        4@ = 0.0
                        5@ = 1504
                    end
                    
                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos -1779.5933 1013.6159 24.8906 radius 100.0 // SF
                    then
                        1@ = -1779.5933
                        2@ = 1013.6159
                        3@ = 24.8906
                        4@ = 268.5924
                        5@ = 1569
                    end
                    
                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos -1617.6293 1122.7632 7.1875 radius 100.0 // SF
                    then
                        1@ = -1617.6293
                        2@ = 1122.7632
                        3@ = 7.1875
                        4@ = 90.0
                        5@ = 1522
                    end
                    
                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos -2266.4968 30.2104 35.3203 radius 100.0 // SF
                    then
                        1@ = -2266.4968
                        2@ = 30.2104
                        3@ = 35.3203
                        4@ = 90.0
                        5@ = 1569
                    end
                    
                    
                    
                    
                    
                    
                    
                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos -205.0714 1183.1011 19.7422 radius 100.0 // LV country
                    then
                        1@ = -205.0714
                        2@ = 1183.1011
                        3@ = 19.7422
                        4@ = 90.0
                        5@ = 1522
                    end
                    
                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos -90.9636 1118.3929 20.786 radius 100.0 // LV country
                    then
                        1@ = -90.9636
                        2@ = 1118.3929
                        3@ = 20.786
                        4@ = 90.0
                        5@ = 1499
                    end
                    
                    
                    
                    
                    
                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos 1271.8824 2564.3086 10.8203 radius 100.0 // LV
                    then
                        1@ = 1271.8824
                        2@ = 2564.3086
                        3@ = 10.8203
                        4@ = 90.0
                        5@ = 1569
                    end
                    
                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos 1601.8657 2846.0781 10.8266 radius 100.0 // LV
                    then
                        1@ = 1601.8657
                        2@ = 2846.0781
                        3@ = 10.8266
                        4@ = 0.0
                        5@ = 1569
                    end
                    
                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos 1607.609 2679.3276 10.8203 radius 100.0 // LV
                    then
                        1@ = 1607.609
                        2@ = 2679.3276
                        3@ = 10.8203
                        4@ = 270.0
                        5@ = 1505
                    end
                    
                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos 2039.6733 2766.5471 10.8266 radius 100.0 // LV
                    then
                        1@ = 2039.6733
                        2@ = 2766.5471
                        3@ = 10.8266
                        4@ = 0.0
                        5@ = 1569
                    end
                    
                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos 1645.4323 2127.3816 11.2031 radius 100.0 // LV
                    then
                        1@ = 1645.4323
                        2@ = 2127.3816
                        3@ = 11.2031
                        4@ = 180.0
                        5@ = 1569
                    end
                    
                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos 1641.7943 2044.843 11.3198 radius 100.0 // LV
                    then
                        1@ = 1641.7943
                        2@ = 2044.843
                        3@ = 11.3198
                        4@ = 270.0
                        5@ = 1569
                    end
                    
                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos 1363.9634 1931.6556 11.4683 radius 100.0 // LV
                    then
                        1@ = 1363.9634
                        2@ = 1931.6556
                        3@ = 11.4683
                        4@ = 90.0
                        5@ = 1569
                    end
                    
                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos 1030.8088 1928.0571 11.4683 radius 100.0 // LV
                    then
                        1@ = 1030.8088
                        2@ = 1928.0571
                        3@ = 11.4683
                        4@ = 270.0
                        5@ = 1569
                    end
                    
                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos 2123.4072 776.0999 11.4453 radius 100.0 // LV
                    then
                        1@ = 2123.4072
                        2@ = 776.0999
                        3@ = 11.4453
                        4@ = 0.0
                        5@ = 1569
                    end
                    
                     if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos 2450.8096 714.3714 11.4683 radius 100.0 // LV
                    then
                        1@ = 2450.8096
                        2@ = 714.3714
                        3@ = 11.4683
                        4@ = 270.0
                        5@ = 1569
                    end
                    
                    
              

                    if and
                        not 1@ == 0.0
                        not 2@ == 0.0
                        not 3@ == 0.0
                        not locate_char_distance_to_coordinates $player_actor pos 1@ 2@ 3@ radius 10.0
                        80C2:   not sphere_onscreen 1@ 2@ 3@ radius 5.0
                    then
                        0AAA: 0@ = get_script_struct_named "INOUTQA"
                        if
                            0@ == 0
                        then
                            3@ -= 1.0
                            0A92: stream_custom_script "In Out Peds.qa" 1@ 2@ 3@ 4@ 5@ chance_door
                            wait 2000
                        end
                    end
                end
            
            wait pause
            
            
            // Sport
            if and
                $ACTIVE_INTERIOR == 0
                $ONMISSION == 0
            then
                1@ = 0.0
                2@ = 0.0
                3@ = 0.0

                if
                    0EEA: locate_char_distance_to_coordinates $player_actor pos 1811.105 -2016.4238 13.5661 radius 100.0
                then
                    1@ = 1811.7898
                    2@ = -2015.0969
                    3@ = 13.5661
                    4@ = 269.4247
                    5@ = 1
                end
                
                if
                    0EEA: locate_char_distance_to_coordinates $player_actor pos 663.7463 -1869.213 5.4609 radius 100.0
                then
                    1@ = 664.3
                    2@ = -1870.513
                    3@ = 5.4609
                    4@ = 180.8206
                    5@ = 2
                end

                if and
                    not 1@ == 0.0
                    not 2@ == 0.0
                    not 3@ == 0.0
                    not locate_char_distance_to_coordinates $player_actor pos 1@ 2@ 3@ radius 10.0
                    80C2:   not sphere_onscreen 1@ 2@ 3@ radius 5.0
                then
                    0AAA: 0@ = get_script_struct_named "SPRPQA"
                    if
                        0@ == 0
                    then
                        0A92: stream_custom_script "Sport Peds.qa" 1@ 2@ 3@ 4@ render_sport render_sport_2 5@
                        wait 2000
                    end
                end
            end
            
            // Cops Car Stop
            if and
                $ACTIVE_INTERIOR == 0
                $ONMISSION == 0
                810F:   not player $PLAYER_CHAR wanted_level > 0
            then
                1@ = 0.0
                2@ = 0.0
                3@ = 0.0

                if
                    0EEA: locate_char_distance_to_coordinates $player_actor pos 55.2909 138.0357 2.4297 radius 150.0
                then
                    1@ = 53.5909
                    2@ = 136.0357
                    3@ = 2.4297
                    4@ = 55.2594
                end
                
                if
                    0EEA: locate_char_distance_to_coordinates $player_actor pos 412.1096 138.823 7.1283 radius 150.0
                then
                    1@ = 412.1096
                    2@ = 138.823
                    3@ = 7.1283
                    4@ = 308.9575
                end
                
                if
                    0EEA: locate_char_distance_to_coordinates $player_actor pos 1147.2362 570.7838 20.2344 radius 150.0
                then
                    1@ = 1147.2362 
                    2@ = 570.7838
                    3@ = 20.2344
                    4@ = 64.3695
                end
                
                if
                    0EEA: locate_char_distance_to_coordinates $player_actor pos -651.9009 -235.8042 63.6563 radius 150.0
                then
                    1@ = -651.9009
                    2@ = -235.8042
                    3@ = 63.6563
                    4@ = 95.3431
                end
                
                if
                    0EEA: locate_char_distance_to_coordinates $player_actor pos 1878.0558 56.1179 35.4774 radius 150.0
                then
                    1@ = 1878.0558
                    2@ = 56.1179
                    3@ = 35.4774
                    4@ = 75.8929
                end
                
                if
                    0EEA: locate_char_distance_to_coordinates $player_actor pos 2721.7361 -177.0635 31.0806 radius 150.0
                then
                    1@ = 2721.7361
                    2@ = -177.0635
                    3@ = 31.0806
                    4@ = 159.977
                end
                
                if
                    0EEA: locate_char_distance_to_coordinates $player_actor pos 932.5128 -186.1939 10.9013 radius 150.0
                then
                    1@ = 932.5128
                    2@ = -186.1939
                    3@ = 10.9013
                    4@ = 263.9814
                end
                
                if
                    0EEA: locate_char_distance_to_coordinates $player_actor pos -1765.1328 -1141.9747 55.5378 radius 150.0
                then
                    1@ = -1765.1328
                    2@ = -1141.9747
                    3@ = 55.5378
                    4@ = 205.5159
                end
                
                if
                    0EEA: locate_char_distance_to_coordinates $player_actor pos -1576.6643 -1181.7435 102.7356 radius 150.0
                then
                    1@ = -1576.6643
                    2@ = -1181.7435
                    3@ = 102.7356
                    4@ = 224.1478
                end
                
                if
                    0EEA: locate_char_distance_to_coordinates $player_actor pos -473.7715 -964.2249 25.7696 radius 150.0
                then
                    1@ = -473.7715
                    2@ = -964.2249
                    3@ = 25.7696
                    4@ = 147.1254
                end
                
                if
                    0EEA: locate_char_distance_to_coordinates $player_actor pos -705.2254 -1397.5195 61.1451 radius 150.0
                then
                    1@ = -705.2254
                    2@ = -1397.5195
                    3@ = 61.1451
                    4@ = 358.7723
                end
                
                if
                    0EEA: locate_char_distance_to_coordinates $player_actor pos -68.5331 -2865.0029 39.7105 radius 150.0
                then
                    1@ = -68.5331
                    2@ = -2865.0029
                    3@ = 39.7105
                    4@ = 307.0719
                end
                
                if
                    0EEA: locate_char_distance_to_coordinates $player_actor pos -2826.5957 -1994.504 38.3287 radius 150.0
                then
                    1@ = -2826.5957
                    2@ = -1994.504
                    3@ = 38.3287
                    4@ = 232.0281
                end
                
                if
                    0EEA: locate_char_distance_to_coordinates $player_actor pos -1414.2354 2290.574 55.1305 radius 150.0
                then
                    1@ = -1414.2354
                    2@ = 2290.574
                    3@ = 55.1305
                    4@ = 203.5028
                end
                
                if
                    0EEA: locate_char_distance_to_coordinates $player_actor pos -759.9772 1288.7683 13.9278 radius 150.0
                then
                    1@ = -759.9772
                    2@ = 1288.7683
                    3@ = 13.9278
                    4@ = 29.903
                end

                if and
                    not 1@ == 0.0
                    not 2@ == 0.0
                    not 3@ == 0.0
                    not locate_char_distance_to_coordinates $player_actor pos 1@ 2@ 3@ radius 30.0
                    80C2:   not sphere_onscreen 1@ 2@ 3@ radius 5.0
                then
                    0AAA: 0@ = get_script_struct_named "PLCRQA"
                    if
                        0@ == 0
                    then
                        0A92: stream_custom_script "Cops Car Stop.qa" 1@ 2@ 3@ 4@ chance_car_search
                        wait 2000
                    end
                end
            end
            
            // trash peds
            if and
                $ACTIVE_INTERIOR == 0
                $ONMISSION == 0
            then
                0E40: get_current_hour 1@
                if and
                    1@ >= 7
                    1@ <= 14
                then
                    0AAA: 0@ = get_script_struct_named "TRSHPQA"
                    if
                        0@ == 0
                    then
                        0A92: stream_custom_script "Trash Peds.qa" chanse_time_trash
                        wait 2000
                    end
                end
            end
            
            wait pause
            
            // Hunter
            if and
                $ACTIVE_INTERIOR == 0
                $ONMISSION == 0
            then
                
                0E40: get_current_hour 1@
                if and
                    1@ >= 6
                    1@ < 18
                then
                
                    1@ = 0.0
                    2@ = 0.0
                    3@ = 0.0

                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos 2349.0168 -773.8714 129.883 radius 120.0
                    then
                        1@ = 2349.0168
                        2@ = -773.8714
                        3@ = 129.883
                    end
                    
                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos 948.8913 74.1752 61.6969 radius 120.0
                    then
                        1@ = 948.8913
                        2@ = 74.1752
                        3@ = 61.6969
                    end
                    
                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos -1314.0436 -1081.106 173.5219 radius 120.0
                    then
                        1@ = -1314.0436
                        2@ = -1081.106
                        3@ = 173.5219
                    end
                    
                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos -1419.5564 -2444.9807 36.8192 radius 120.0
                    then
                        1@ = -1419.5564
                        2@ = -2444.9807
                        3@ = 36.8192
                    end
                    
                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos -432.4246 -2537.6499 120.5966 radius 120.0
                    then
                        1@ = -432.4246
                        2@ = -2537.6499
                        3@ = 120.5966
                    end
                    
                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos -1648.2106 -1963.1835 97.3817 radius 120.0
                    then
                        1@ = -1648.2106
                        2@ = -1963.1835
                        3@ = 97.3817
                    end
                    
                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos -500.2265 186.7752 8.0184 radius 120.0
                    then
                        1@ = -500.2265
                        2@ = 186.7752
                        3@ = 8.0184
                    end

                    if and
                        not 1@ == 0.0
                        not 2@ == 0.0
                        not 3@ == 0.0
                        not locate_char_distance_to_coordinates $player_actor pos 1@ 2@ 3@ radius 20.0
                        80C2:   not sphere_onscreen 1@ 2@ 3@ radius 5.0
                    then
                        0AAA: 0@ = get_script_struct_named "HUNTQA"
                        if
                            0@ == 0
                        then
                            0A92: stream_custom_script "Rural Hunter.qa" 1@ 2@ 3@ render_bird chance_hunt
                            wait 2000
                        end
                    end
                end
            end
            
            wait pause
            
            // crime scene
            if and
                $ACTIVE_INTERIOR == 0
                $ONMISSION == 0
                810F:   not player $PLAYER_CHAR wanted_level > 0
            then

                0E40: get_current_hour 1@
                if or
                    1@ >= 22
                    1@ < 4
                then

                    1@ = 0.0
                    2@ = 0.0
                    3@ = 0.0

                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos -2352.4805 -42.9748 35.3125 radius 120.0
                    then
                        1@ = -2352.4805
                        2@ = -42.9748
                        3@ = 35.3125
                        4@ = 270.0
                    end
                    
                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos -2654.5081 -97.305 4.0798 radius 120.0
                    then
                        1@ = -2654.5081
                        2@ = -97.305
                        3@ = 4.0798
                        4@ = 143.7534
                    end
                    
                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos 1931.0481 -1591.9308 13.5599 radius 120.0
                    then
                        1@ = 1931.0481
                        2@ = -1591.9308
                        3@ = 13.5599
                        4@ = 40.7594
                    end
                    
                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos 2491.2512 -1404.2994 28.8384 radius 120.0
                    then
                        1@ = 2491.2512
                        2@ = -1404.2994
                        3@ = 28.8384
                        4@ = 354.2448
                    end
                    
                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos 826.3709 -1440.7517 13.4967 radius 120.0
                    then
                        1@ = 826.3709
                        2@ = -1440.7517
                        3@ = 13.4967
                        4@ = 315.9945
                    end
                    
                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos 45.7337 -237.8533 1.6117 radius 120.0
                    then
                        1@ = 45.7337
                        2@ = -237.8533
                        3@ = 1.6117
                        4@ = 123.0027
                    end
                    
                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos 2480.4148 1160.9052 10.8203 radius 120.0
                    then
                        1@ = 2480.4148
                        2@ = 1160.9052
                        3@ = 10.8203
                        4@ = 184.4948
                    end
                    
                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos 961.4994 2326.0408 10.8203 radius 120.0
                    then
                        1@ = 961.4994
                        2@ = 2326.0408
                        3@ = 10.8203
                        4@ = 318.0854
                    end
                    
                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos 1334.4023 -859.0537 39.5459 radius 120.0
                    then
                        1@ = 1334.4023
                        2@ = -859.0537
                        3@ = 39.5459
                        4@ = 284.2452
                    end
                    
                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos 1223.6703 135.558 20.4968 radius 120.0
                    then
                        1@ = 1223.6703
                        2@ = 135.558
                        3@ = 20.4968
                        4@ = 44.1595
                    end
                    

                    if and
                        not 1@ == 0.0
                        not 2@ == 0.0
                        not 3@ == 0.0
                        not locate_char_distance_to_coordinates $player_actor pos 1@ 2@ 3@ radius 30.0
                        80C2:   not sphere_onscreen 1@ 2@ 3@ radius 5.0
                    then
                        0AAA: 0@ = get_script_struct_named "CRIMQA"
                        if
                            0@ == 0
                        then
                            0A92: stream_custom_script "Police Crime Scene.qa" 1@ 2@ 3@ 4@ render_flash chance_crime render_book
                            wait 2000
                        end
                    end
                end
            end
            
            wait pause
            
            // tourist
            if and
                $ACTIVE_INTERIOR == 0
                $ONMISSION == 0
            then

                    1@ = 0.0
                    2@ = 0.0
                    3@ = 0.0

                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos 2289.2295 -637.6921 134.0576 radius 120.0
                    then
                        1@ = 2289.2295
                        2@ = -637.6921
                        3@ = 134.0576
                        4@ = 218.7008
                    end
                    
                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos 2000.2236 -791.2094 133.5223 radius 120.0
                    then
                        1@ = 2000.2236
                        2@ = -791.2094
                        3@ = 133.5223
                        4@ = 79.7467
                    end
                    
                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos 194.5998 -866.7365 14.9705 radius 120.0
                    then
                        1@ = 194.5998
                        2@ = -866.7365
                        3@ = 14.9705
                        4@ = 274.6888
                    end
                    
                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos 2694.668 111.5114 46.4276 radius 120.0
                    then
                        1@ = 2694.668
                        2@ = 111.5114
                        3@ = 46.4276
                        4@ = 308.0824
                    end
                    
                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos 380.9699 -467.0851 24.727 radius 120.0
                    then
                        1@ = 380.9699
                        2@ = -467.0851
                        3@ = 24.727
                        4@ = 121.1305
                    end
                    
                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos -364.534 -2423.6602 98.9759 radius 120.0
                    then
                        1@ = -364.534
                        2@ = -2423.6602
                        3@ = 98.9759
                        4@ = 88.6765
                    end
                    
                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos -852.8892 -2634.0032 96.3716 radius 120.0
                    then
                        1@ = -852.8892
                        2@ = -2634.0032
                        3@ = 96.3716
                        4@ = 287.9351
                    end
                    
                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos -1909.0815 -2182.168 81.766 radius 120.0
                    then
                        1@ = -1909.0815
                        2@ = -2182.168
                        3@ = 81.766
                        4@ = 103.7402
                    end
                    
                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos -1687.5151 -1011.913 72.4267 radius 120.0
                    then
                        1@ = -1687.5151
                        2@ = -1011.913
                        3@ = 72.4267
                        4@ = 2.846
                    end
                    

                    if and
                        not 1@ == 0.0
                        not 2@ == 0.0
                        not 3@ == 0.0
                        not locate_char_distance_to_coordinates $player_actor pos 1@ 2@ 3@ radius 20.0
                        80C2:   not sphere_onscreen 1@ 2@ 3@ radius 5.0
                    then
                        0AAA: 0@ = get_script_struct_named "TOURQA"
                        if
                            0@ == 0
                        then
                            0A92: stream_custom_script "Tourists.qa" 1@ 2@ 3@ 4@ render_map chance_tourist
                            wait 2000
                        end
                    end
            end
            
            wait pause
            
            // monk
            if and
                $ACTIVE_INTERIOR == 0
                $ONMISSION == 0
            then
                0E40: get_current_hour 1@
                if and
                    1@ > 6
                    1@ < 16
                then
                    1@ = 0.0
                    2@ = 0.0
                    3@ = 0.0

                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos 2074.1306 -414.2886 111.2958 radius 120.0
                    then
                        1@ = 2074.1306 
                        2@ = -414.2886
                        3@ = 111.2958
                        4@ = 55.3531
                    end
                    
                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos -1552.2023 -881.5574 179.2431 radius 120.0
                    then
                        1@ = -1552.2023
                        2@ = -881.5574
                        3@ = 179.2431
                        4@ = 31.1793
                    end
                    
                    if
                        0EEA: locate_char_distance_to_coordinates $player_actor pos -1192.991 1985.4861 136.8511 radius 120.0
                    then
                        1@ = -1192.991
                        2@ = 1985.4861
                        3@ = 136.8511
                        4@ = 138.8336
                    end

                    if and
                        not 1@ == 0.0
                        not 2@ == 0.0
                        not 3@ == 0.0
                        not locate_char_distance_to_coordinates $player_actor pos 1@ 2@ 3@ radius 20.0
                        80C2:   not sphere_onscreen 1@ 2@ 3@ radius 5.0
                    then
                        0AAA: 0@ = get_script_struct_named "MONKQA"
                        if
                            0@ == 0
                        then
                            0A92: stream_custom_script "Monk.qa" 1@ 2@ 3@ 4@ chance_monk
                            wait 2000
                        end
                    end
                end
            end
            

    end
end